<div class="m-2">

    <div class="d-block mt-2">
        <i class="fa fa-eye mr-1"></i><label class="title mr-4">{{summary.title}}的任务</label>

        <div class="btn-link pull-right mr-2" onclick="return switch_viewmode();">
            <i class="fa fa-toggle-on mr-1"></i>切换为【{{session.gantt_mode and '看板' or '甘特图'}}】模式
        </div>
    </div>

    <hr class="m-0">

    <div class="container mw-100 mt-2">
        {[ session.gantt_mode and "dashboard/tasks/mode_gantt.html" or "dashboard/tasks/mode_normal.html" ]}
    </div>
</div>

<div id="task-view" class="task-view-pane invisible">
    <div id="task-info-pane">
    </div>
</div>

<script type='text/javascript'>

function open_task(tid) {
    $('#task-info-pane').empty();
    $('#task-info-pane').get(0).innerHTML = '<div class="text-center text-muted" style="margin-top: 40%"><i class="fa fa-spinner fa-spin fa-3x fa-fw"></i></div>';
    $('#task-view').removeClass('invisible');
    $('#task-view').addClass('visible');
    $('.xdsoft_datetimepicker').remove();

    $.post("{*readonly and '/dashboard/tasks/readonly_info' or '/dashboard/tasks/info'*}", {id : tid}, function(ret) {
        $('#task-info-pane').empty();
        $('#task-info-pane').append($(ret));
    }, 'html');
}

function switch_viewmode() {
    $.post('/dashboard/tasks/switch_viewmode', function(ret) {
        if (location.pathname == '/' || location.pathname == '/dashboard/tasks/') location.reload();
        else last_pressed_button.click();
    }, 'json');
}
</script>